/*
 * @Author: your name
 * @Date: 2022-03-23 21:08:55
 * @LastEditTime: 2022-03-26 09:21:23
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \RVMDK（uv5）c:\Users\wangzhen\Desktop\张毕设\程序代码\毕设程序\Zigbee_Server\Components\DevLog\DevLog.h
 */
#ifndef __DEV_LOG_H
#define	__DEV_LOG_H

#include "easyflash.h"
#include "stdio.h"
#include "string.h"
#include "stdint.h"

/**
 * @brief 震动记录;
 */
typedef struct {
    uint16_t    ShortAddr;
    uint32_t    timeStamp;
} Log_Shake_t;

/**
 * @brief 开窗记录;
 */
typedef struct {
    uint16_t    ShortAddr;
    uint32_t    timeStamp;
} Log_Open_t;

/**
 * @brief 最大[震动]记录数
 */
#define LOG_SHAKE_MAX_COUNT		(25)

/**
 * @brief 最大[开窗]记录数
 */
#define LOG_OPEN_MAX_COUNT		(25)

// 初始化
void DevLog_Init(void);

// 次数存储
EfErrCode DevLog_ShakeCount_Set(uint32_t ShakeCount);
EfErrCode DevLog_ShakeCount_Get(uint32_t* ShakeCount);
EfErrCode DevLog_ShakeCount_Clean(void);

EfErrCode DevLog_OpenCount_Set(uint32_t OpenCount);
EfErrCode DevLog_OpenCount_Get(uint32_t* OpenCount);
EfErrCode DevLog_OpenCount_Clean(void);

// 设备记录;
EfErrCode DevLog_Shake_Add(Log_Shake_t ShakeLog);
EfErrCode DevLog_Shake_Get(uint32_t LogCnt , Log_Shake_t* ShakeLog);
EfErrCode DevLog_Shake_Clear(void);
void DevLog_Shake_Print(int Count, Log_Shake_t ShakeLog);
void DevLog_Shake_All_Print(void);
void DevLog_Shake_Test(void);

EfErrCode DevLog_Open_Add(Log_Open_t OpenLog);
EfErrCode DevLog_Open_Get(uint32_t LogCnt , Log_Open_t* OpenLog);
EfErrCode DevLog_Open_Clear(void);
void DevLog_Open_Print(int Count, Log_Open_t OpenLog);
void DevLog_Open_All_Print(void);
void DevLog_Open_Test(void);

#endif /* __DEV_LOG_H */
